#include<iostream>
#include<set>
using namespace std;
int n;
set<int>s;
int main()
{
	cin >> n;
	for (int i = 0; i < n; i++) {
		int x;
		cin >> x;
		s.insert(x);
	}
	cout << s.size() << endl;
	for (int x : s) {
		cout << x << " ";
	}
	return 0;
}